Optimal. Leaf size=73 \[ -\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}-\frac {c (b c-4 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {382, 91, 81, 65,
214} \begin {gather*} -\frac {c (b c-4 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}}+\frac {c^2 x \sqrt {a+\frac {b}{x}}}{a}-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 81
Rule 91
Rule 214
Rule 382
Rubi steps
\begin {align*} \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx &=-\text {Subst}\left (\int \frac {(c+d x)^2}{x^2 \sqrt {a+b x}} \, dx,x,\frac {1}{x}\right )\\ &=\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}-\frac {\text {Subst}\left (\int \frac {-\frac {1}{2} c (b c-4 a d)+a d^2 x}{x \sqrt {a+b x}} \, dx,x,\frac {1}{x}\right )}{a}\\ &=-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}+\frac {(c (b c-4 a d)) \text {Subst}\left (\int \frac {1}{x \sqrt {a+b x}} \, dx,x,\frac {1}{x}\right )}{2 a}\\ &=-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}+\frac {(c (b c-4 a d)) \text {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+\frac {b}{x}}\right )}{a b}\\ &=-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}-\frac {c (b c-4 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 66, normalized size = 0.90 \begin {gather*} \frac {\sqrt {a+\frac {b}{x}} \left (-2 a d^2+b c^2 x\right )}{a b}+\frac {c (-b c+4 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(347\) vs.
\(2(63)=126\).
time = 0.04, size = 348, normalized size = 4.77
method | result | size |
risch | \(-\frac {\left (a x +b \right ) \left (-b \,c^{2} x +2 a \,d^{2}\right )}{b a x \sqrt {\frac {a x +b}{x}}}+\frac {\left (\frac {2 c \ln \left (\frac {\frac {b}{2}+a x}{\sqrt {a}}+\sqrt {a \,x^{2}+b x}\right ) d}{\sqrt {a}}-\frac {c^{2} \ln \left (\frac {\frac {b}{2}+a x}{\sqrt {a}}+\sqrt {a \,x^{2}+b x}\right ) b}{2 a^{\frac {3}{2}}}\right ) \sqrt {x \left (a x +b \right )}}{x \sqrt {\frac {a x +b}{x}}}\) | \(132\) |
default | \(-\frac {\sqrt {\frac {a x +b}{x}}\, \left (-2 \sqrt {a \,x^{2}+b x}\, a^{\frac {5}{2}} d^{2} x^{2}-4 \sqrt {a \,x^{2}+b x}\, a^{\frac {3}{2}} b c d \,x^{2}-\ln \left (\frac {2 \sqrt {a \,x^{2}+b x}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a^{2} b \,d^{2} x^{2}-2 \ln \left (\frac {2 \sqrt {a \,x^{2}+b x}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a \,b^{2} c d \,x^{2}-2 a^{\frac {5}{2}} \sqrt {x \left (a x +b \right )}\, d^{2} x^{2}+4 a^{\frac {3}{2}} \sqrt {x \left (a x +b \right )}\, b c d \,x^{2}-2 \sqrt {a}\, \sqrt {x \left (a x +b \right )}\, b^{2} c^{2} x^{2}+\ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a^{2} b \,d^{2} x^{2}-2 \ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a \,b^{2} c d \,x^{2}+\ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) b^{3} c^{2} x^{2}+4 \left (a \,x^{2}+b x \right )^{\frac {3}{2}} a^{\frac {3}{2}} d^{2}\right )}{2 x \sqrt {x \left (a x +b \right )}\, b^{2} a^{\frac {3}{2}}}\) | \(348\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 129 vs.
\(2 (63) = 126\).
time = 0.50, size = 129, normalized size = 1.77 \begin {gather*} \frac {1}{2} \, c^{2} {\left (\frac {2 \, \sqrt {a + \frac {b}{x}} b}{{\left (a + \frac {b}{x}\right )} a - a^{2}} + \frac {b \log \left (\frac {\sqrt {a + \frac {b}{x}} - \sqrt {a}}{\sqrt {a + \frac {b}{x}} + \sqrt {a}}\right )}{a^{\frac {3}{2}}}\right )} - \frac {2 \, c d \log \left (\frac {\sqrt {a + \frac {b}{x}} - \sqrt {a}}{\sqrt {a + \frac {b}{x}} + \sqrt {a}}\right )}{\sqrt {a}} - \frac {2 \, \sqrt {a + \frac {b}{x}} d^{2}}{b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.50, size = 158, normalized size = 2.16 \begin {gather*} \left [-\frac {{\left (b^{2} c^{2} - 4 \, a b c d\right )} \sqrt {a} \log \left (2 \, a x + 2 \, \sqrt {a} x \sqrt {\frac {a x + b}{x}} + b\right ) - 2 \, {\left (a b c^{2} x - 2 \, a^{2} d^{2}\right )} \sqrt {\frac {a x + b}{x}}}{2 \, a^{2} b}, \frac {{\left (b^{2} c^{2} - 4 \, a b c d\right )} \sqrt {-a} \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a x + b}{x}}}{a}\right ) + {\left (a b c^{2} x - 2 \, a^{2} d^{2}\right )} \sqrt {\frac {a x + b}{x}}}{a^{2} b}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 24.78, size = 114, normalized size = 1.56 \begin {gather*} d^{2} \left (\begin {cases} - \frac {1}{\sqrt {a} x} & \text {for}\: b = 0 \\- \frac {2 \sqrt {a + \frac {b}{x}}}{b} & \text {otherwise} \end {cases}\right ) + \frac {\sqrt {b} c^{2} \sqrt {x} \sqrt {\frac {a x}{b} + 1}}{a} - \frac {4 c d \operatorname {atan}{\left (\frac {1}{\sqrt {- \frac {1}{a}} \sqrt {a + \frac {b}{x}}} \right )}}{a \sqrt {- \frac {1}{a}}} - \frac {b c^{2} \operatorname {asinh}{\left (\frac {\sqrt {a} \sqrt {x}}{\sqrt {b}} \right )}}{a^{\frac {3}{2}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.62, size = 63, normalized size = 0.86 \begin {gather*} \frac {c^2\,x\,\sqrt {a+\frac {b}{x}}}{a}-\frac {2\,d^2\,\sqrt {a+\frac {b}{x}}}{b}+\frac {c\,\mathrm {atanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )\,\left (4\,a\,d-b\,c\right )}{a^{3/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________